package cz.muni.fi.pa165.sme.api;

import java.util.List;

import cz.muni.fi.pa165.sme.api.to.SportActivityRecordTO;
import cz.muni.fi.pa165.sme.api.to.SportActivityTO;
import cz.muni.fi.pa165.sme.api.to.UserTO;

/**
 * The interface for operation with {@link SportActivityRecordTO}
 *
 * @author jirankova
 */
public interface SportActivityRecordService {

	/**
	 * Adds a new {@link SportActivityRecordTO} to a storage, creates its ID. Object's ID must be null.
	 *
	 * @param sportActivityRecord {@link SportActivityRecordTO} to be created.
	 */
	void createSportActivityRecord(final SportActivityRecordTO sportActivityRecord);

	/**
	 * Removes a {@link SportActivityRecordTO} object from a storage. Object's ID must not be null.
	 *
	 * @param sportActivityRecord {@link SportActivityRecordTO} to be removed.
	 */
	void deleteSportActivityRecord(final SportActivityRecordTO sportActivityRecord);

	/**
	 * Updates a {@link SportActivityRecordTO} object as requested. Object's ID must not be null; parameters can be
	 * changed to null where applicable.
	 *
	 * @param sportActivityRecord {@link SportActivityRecordTO} to be updated
	 */
	void updateSportActivityRecord(final SportActivityRecordTO sportActivityRecord);

	/**
	 * Finds a {@link SportActivityRecordTO} object by its ID.
	 *
	 * @param id ID to be looked up in the storage
	 * @return {@link SportActivityRecordTO} with the provided ID, or null if none found
	 */
	SportActivityRecordTO findSportActivityRecordById(final Long id);

	/**
	 * Finds all {@link SportActivityRecordTO}s related to the provided {@link UserTO}.
	 *
	 * @param user {@link UserTO} object to get the data for; must not be null
	 * @return list of all related {@link SportActivityRecordTO}s; never null.
	 */
	List<SportActivityRecordTO> findAllSportActivityRecordsByUser(final UserTO user);

	/**
	 * Finds all {@link SportActivityRecordTO}s related to the provided {@link SportActivityRecordTO}.
	 *
	 * @param sportActivity {@link SportActivityTO} object to get the data for; must not be null
	 * @return list of all related {@link SportActivityRecordTO}s; never null
	 */
	List<SportActivityRecordTO> findAllSportActivityRecordsBySportActivity(final SportActivityTO sportActivity);

	/**
	 * Returns all {@link SportActivityRecordTO}s from the storage.
	 *
	 * @return list of all {@link SportActivityRecordTO}s; never null.
	 */
	List<SportActivityRecordTO> findAllSportActivityRecords();

	/**
	 * Check existnece in the database. Provided input cannot be null.
	 *
	 * @param sportActivityRecordTO to be checked for existence
	 * @return true if in database, false if either not there or if id is null
	 */
	boolean exists(final SportActivityRecordTO sportActivityRecordTO);
}
